// globals.dart

import 'package:flutter_riverpod/flutter_riverpod.dart';


class AppProviders {
  static ProviderContainer? container;

  static void initialize(ProviderContainer c) => container = c;

  static T read<T>(ProviderListenable<T> provider) {
    if (container == null) {
      throw StateError('AppProviders.container is not initialized. Call AppProviders.initialize() first.');
    }
    return container!.read(provider);
  }
}

T getProvider<T>(ProviderListenable<T> provider) {
  return AppProviders.read(provider);
}